export interface ResponseData {
    status: number
    success?: {
        message: string
    }
    error?: {
        message: string
        code: number
    }
}

// 刷新token
export interface TokenRefreshResponse extends ResponseData{
    data: string
}


export interface UpdateUserInfo {
    username: string
    password: string
    creator: string
    id: number
}
export interface UpdateUserInfoResponse extends ResponseData{
    data: UserInfo[]
}


export interface AddUserInfo {
    username: string
    password: string
    creator: string
}
export interface AddUserInfoResponse extends ResponseData{
    data: UserInfo[]
}

export interface DeleteUserInfo {
    username: string
    id: number
}
export interface DeleteUserInfoResponse extends ResponseData{
    data: UserInfo[]
}

export interface Authentication {
    username: string,
    password: string,
}
export interface AuthenticationResponse extends ResponseData{
    data: {
        token: string
        identity: string[]
        user_id: number
    }
}

export interface UpdatePermissions {
    creator: string,
    identity: string[],
    id: number,
}
export interface UpdatePermissionsResponse extends ResponseData{
    data: UserInfo[]
}


export interface UserInfo {
    id: number
    identity: string[]
    username: string
    password: string
    creation_date_str: string
    creator: string
}

export interface UserInfoListResponse extends ResponseData{
    data: UserInfo[]
}